home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)TA / (A)TAP.ADF / DS.readme < prev    next >
Text File  |  1987-02-03  |  16KB  |  347 lines

  1.  
  2.  
  3.                         D i s k S a l v 
  4.  
  5.                  AmigaDOS Disk Salvage Program
  6.  
  7.                  Copyright 1988 by Dave Haynie
  8.  
  9.                   Version 1.2 for AmigaOS 1.3
  10.                
  11.  
  12. INTRODUCTION
  13.  
  14.     DiskSalv V1.2 is a disk recovery program for all Amiga file
  15. system devices that use either the AmigaOS V1.2/V1.3 Standard File
  16. System or the AmigaOS V1.3 Fast File System.  DiskSalv will scan a bad
  17. disk volume for anything that can be recovered, and will restore these
  18. items to any AmigaDOS volume.  It does not make any attempt to fix the
  19. bad device in place; thus, any file that can't be restored with DiskSalv
  20. might possibly be restored with an alternate method.
  21.  
  22.  
  23. 1. THE BASICS OF DISKSALV V1.2
  24.  
  25.     DiskSalv V1.2 (from here on referred to as "DiskSalv") is a
  26. program designed to "salvage" any files and directories from a damaged
  27. AmigaDOS file system device to a good one.  DiskSalv is run from an
  28. Amiga CLI, and in the simplest case is used very much like the AmigaDOS
  29. "DiskCopy" program.  For example, to recover files from a bad disk in
  30. DF0: and restore them on a good disk DF1:, the user will type:
  31.  
  32.     1> DiskSalv FROM DF0: TO DF1:
  33.  
  34. Here the "FROM" and "TO" keywords are fully optional if the ordering of
  35. the input and output devices is kept INPUT OUTPUT.  The following line
  36. would also achieve the same result:
  37.  
  38.     1> DiskSalv TO DF1: FROM DF0:
  39.  
  40. In either case, DiskSalv will immediately print to the shell's screen:
  41.  
  42.     DiskSalv V1.2 Copyright ⌐ 1988 by Dave Haynie
  43.  
  44.     Salvage FROM Device DF0: TO Path DF1:
  45.  
  46.       DEVICE     =    trackdisk.device   (DF0:)
  47.       UNIT       =        0    FLAGS      =        0
  48.       HEADS      =        2    SECTORS    =       11
  49.       LOCYL      =        0    HICYL      =       79
  50.           LOBLOCK    =        0    HIBLOCK    =     1759
  51.       RESERVED   =        2    MEMTYPE    =        3
  52.       ROOT BLOCK =      880    DISK SIZE  =     1760
  53.  
  54.     Scan Range: START 2, STOP 1759, Expecting Standard FileSystem
  55.  
  56.     Should I continue [Y]
  57.  
  58. At this point, a simple RETURN entered will start up the recovery
  59. process, while an "N" followed by a RETURN will abort the recovery. 
  60.  
  61. 1.1 The Scan Phase
  62.  
  63.     If we proceed with the recovery, DiskSalv will start the first
  64. phase of it's recovery.  At this point, the input device will be scanned
  65. from start to finish (blocks 2 though 1759).  DiskSalv is looking for
  66. valid AmigaDOS file or directory blocks.  A small Intuition window
  67. called "DiskSalv Scan" will open on the Amiga's WorkBench screen.  There
  68. are three columns in this window, BLOCK, NODES, and TYPE.  As each block
  69. is read, it's number is displayed under BLOCK.  This happens pretty
  70. quickly; ordinarily, there's no need to examine individual block numbers
  71. anyway.  The TYPE field indicates whether the block is a file (FILE),
  72. root directory (ROOT), user directory (UDIR), data block (DATA), unused
  73. block (FREE), unknown block type (????), or bad block (ERR!).  Note that
  74. under the new AmigaDOS V1.3 Fast FileSystem, there's no way to
  75. distinguish between DATA and FREE blocks during a scan, so these are
  76. always displayed as unknown blocks.  The final field, NODES, indicates
  77. the number of user directory or file blocks that have been located so
  78. far.  
  79.  
  80.     The other feature of this phase is the file list, which takes
  81. place on the screen.  The shell window will indicate "Building Directory
  82. Map...", and the name of each directory and file that's found will be
  83. displayed under this heading.  Note that at any time during this
  84. scanning phase, a ^C typed to the shell window will abort DiskSalv.
  85.  
  86. 1.2 The Directory Resolution Phase
  87.  
  88.     The next phase is usually a very short one.  The scanning window
  89. will disappear, and the shell window will indicate that DiskSalv is
  90. "Resolving Stray Directories...".  During the scanning phase, when
  91. DiskSalv finds a file block, it attaches it to a directory in it's
  92. directory list.  To make the scan phase fast, however, DiskSalv only
  93. does a single linear pass over the input disk during that phase.  If the
  94. parent directory for a file or subdirectory isn't available, DiskSalv
  95. makes a dummy directory for it in it's directory list.
  96.  
  97.     Normally, all of those dummy directories get changed into normal
  98. ones as they are found in the scan.  However, there are some DiskSalv
  99. modes (covered later) that may result in only a partial scan being
  100. performed.  In this case, valid directory entires may be outside of the
  101. scanning range.  In order to get the proper names of such directories,
  102. the resolution phase goes through the directory entires in it's dummy
  103. list and tries to find real directories to match them.  If a directory
  104. can't be found, it was probably located on a bad block.  That's no
  105. problem, all that's lost is the name of that directory, not any of it's
  106. contents.
  107.  
  108. 1.3 The Directory Pruning Phase
  109.  
  110.     The next pass happens purely in memory, and it attempts to
  111. remove any empty directories from the directory list.  There are rarely
  112. any empty directories that need to be restored, and there are some
  113. DiskSalv options that tend to force a number of empty directories to be
  114. created in the directory list.  This pass can be overridden if empty
  115. directories are deemed important.
  116.  
  117. 1.4 The Disk Salvage Phase
  118.  
  119.     In this next phase, the disk structure is actually restored to
  120. the output device.  This proceeds until stopped via ^C, or until the
  121. output device is full.  If the output device fills up, a new one can be
  122. inserted if the device supports removable media.  The most common form
  123. of this would be floppy disk.
  124.  
  125.     There are certain output devices which may not return proper
  126. volume sizing information through AmigaDOS.  For instance, the RAM:
  127. device always says it's full.  A DiskSalv option allows output size
  128. checking to be turned off, and it's automatically selected if the
  129. output device is RAM:.
  130.  
  131.     DiskSalv uses normal AmigaDOS I/O routines to re-create the
  132. recovered files.  Thus, it may restore to a subdirectory instead of the
  133. root of a device.  If a subdirectory is specified that doesn't exit,
  134. DiskSalv will create it.  Similarly, DiskSalv may output to a logical
  135. volume name instead of a device name.
  136.  
  137.     Finally, there are occasions under which there may be file name
  138. collisions.  If the output device has a file by the same name as one
  139. that's on the input device, such a collision occurs.  DiskSalv won't
  140. overwrite files.  Instead, the colliding file is renamed before it is
  141. rebuilt.  An extension is added to it, starting at "-0" and going on up
  142. to "-100" as collisions continue to occur.
  143.  
  144.  
  145. 2. DISKSALV REFERENCE GUIDE
  146.  
  147.     The DiskSalv program is run and controlled completely via 
  148. command-line arguments.  It should run without problem from all Amiga
  149. shell programs; it currently can't be run from the WorkBench.
  150.  
  151. 2.1 Command-Line Options
  152.  
  153.     There are quite a few options in DiskSalv that'll modify in
  154. various ways the recovery action described above.  The syntax for the
  155. DiskSalv command line is given as:
  156.  
  157.     DiskSalv [FROM] InDev: [TO] OutPath [FFS|NOFFS]
  158.              [ASK] [NOPRUNE] [NOCHECK] [NOTD] [QUICK]
  159.              [START block|ROOT] [STOP [+]block]
  160.              [MASK [a|A][r|R][w|W][e|E][d|D][p|P][s|S]] 
  161.  
  162.     or
  163.  
  164.     DiskSalv HELP|INFO
  165.  
  166. The first form actually runs the program; the second form gives the user
  167. a little built-in documentation.  In each case, text in brackets ("[]")
  168. indicates an optional parameter, text outside of brackets indicates a
  169. required parameter, and "|" indicates a choice of parameters.  The
  170. options are:
  171.  
  172. ASK
  173.     This options allows the Disk Salvage pass to proceed
  174.     interactively instead of automatically.  The user is prompted
  175.     at each file or directory.  A reply of 'Y' will recover that
  176.     file or move into that directory, a reply of 'N' will skip that
  177.     item.  Replying '?' will list all the valid options.  A reply of
  178.     'A' will recover everything left at the current directory level;
  179.     a reply of 'U' will skip everything left at the current
  180.     directory level.  Finally, a reply of 'Q' will quit the program
  181.     completely. 
  182.  
  183. FFS | NOFFS
  184.     This allows the disk's filesystem to be selected.  Normally,
  185.     DiskSalv can tell the difference between a fast and standard
  186.     filesystem disk, and will act accordingly.  However, if that
  187.     disk is badly damaged, this assumption may be incorrect.  In
  188.     such a case, DiskSalv will usually assume standard filesystem.
  189.     If it's assumption is wrong, the filesystem can be forced with
  190.     these options.
  191.  
  192. FROM InDev: 
  193.     This option allows an input device to be specified.  The input
  194.     device must be a real device, not a path specification.  The
  195.     FROM keyword is optional, but can be used to allow FROM and TO
  196.     specifications to be given in any order.
  197.  
  198. HELP
  199.     The HELP option lists some information about the various options
  200.     available.  It should be specified in the command line without
  201.     any other options.
  202.  
  203. INFO
  204.     The INFO option lists some information about the program, it's
  205.     distribution, bug reporting, and other stuff.  It should be
  206.     specified in the command line without any other options.
  207.  
  208. MASK [a|A][r|R][w|W][e|E][d|D][p|P][s|S]
  209.     This options allows the user to specify a protection bit mask as
  210.     a filter.  The supported bits are "A" for Archive, "R" for Read,
  211.     "W" for Write, "E" for Execute, "D" for Delete, "P for Pure, and
  212.     "S" for Script.  Specifying the bit in lowercase indicates a mask
  213.     for that bit not set, a bit in uppercase indicates a mask for that
  214.     bit set.  For example, specifying "MASK a" will scan for only
  215.     those files that don't have the archive bit set; "MASK WD" will
  216.     scan only for those files with Write and Delete permission
  217.     enabled.  Any bits not specifically MASKed can be in either state.
  218.  
  219. NOCHECK
  220.     This option prevents the output device's size from being
  221.     checked.  Normally this would only be used with a device that
  222.     doesn't properly report it's size, and it's automatically
  223.     invoked with output to RAM:.
  224.  
  225. NOPRUNE
  226.     This option prevents the directory pruning phase from taking
  227.     place.  If the input device contains empty directories that must
  228.     be restored, use this option.
  229.  
  230. NOTD
  231.     DiskSalv does some special optimizations when it's recovering from
  232.     a floppy disk device based on the "trackdisk.device" driver.  While
  233.     there's currently no real use for this option, a future version of
  234.     "trackdisk.device" might possibly not work with these enhancements.
  235.     This option will turn the enhancements off, making a recovery from
  236.     the "trackdisk.device" work exactly like any other recovery.
  237.  
  238. QUICK
  239.     This option performs a quick scan.  The scan speed is improved
  240.     by not displaying the block number and type information for every
  241.     block.  This doesn't make as much difference as it did in the
  242.     earlier versions of DiskSalv; the "DiskSalv Scan" window routine
  243.     has been greatly sped up this display.
  244.  
  245. TO OutPath 
  246.     This option allows an output path to be specified.  The output
  247.     device can be any valid AmigaDOS file device specification.  The 
  248.     TO keyword is optional, but can be used to allow FROM and TO
  249.     specifications to be given in any order.
  250.  
  251. START block | ROOT
  252.     This option allows the scanning routine to start at any place on
  253.     the input device.  This position is either given as a decimal
  254.     block number, or as the string ROOT.  Since many files are
  255.     clustered after the directory root on most disks, it's often
  256.     possible to get many of a disk's files back starting the scan
  257.     there instead of at the start of the disk.  
  258.  
  259. STOP [+] block
  260.     This option allows the scanning routine to stop at any place on
  261.     the input device.  This position is either given as a decimal
  262.     block number, or (via the optional "+") as an offset relative to
  263.     the START of the disk.  Thus, specifying START ROOT STOP +50
  264.     would scan a disk's root and the next 49 blocks.
  265.  
  266. 2.2 Input Device Specification
  267.  
  268.     DiskSalv requires a DOS name specification for its input device.
  269. Such a name is automatically created by the operating system for each
  270. 3.5" disk drive attached, and for some hardware add-ons during automatic
  271. device binding process initiated by the AmigaDOS BindDrivers command.  
  272. Other DOS names are created by the Mount command and the MountList file.
  273.  
  274.     On occasion, a few problems show up in this theory.  First of all,
  275. a device like a hard disk may store its physical layout, necessary to
  276. create a DOS node, on the disk itself.  If the disk is damaged, this 
  277. special information may not be available any longer, and as a result, the
  278. hard disk's device driver won't be able to create a DOS node.  In this
  279. case, the user will have to create a MountList entry by hand for the 
  280. device.  This device will then be Mount-ed, and DiskSalv can take over
  281. from there.
  282.  
  283.     The other problem I've found is that allowing AmigaDOS to access
  284. a bad volume can occasionally result in a system crash.  With a mounted
  285. volume, that's no big problem; AmigaDOS won't try to access the
  286. device, or even load the device driver, until that drive is actually
  287. accessed.  It's OK, and in fact required by DiskSalv, to just "Mount"
  288. the device.  With floppies, this is a bit harder.  The trackdisk.device
  289. looks for a diskchange signal from all 3.5" floppies, whenever a floppy
  290. is changed.  So as soon as you insert a floppy disk, DOS will look at it.
  291. If that disk causes a crash, it'll take effect as soon as the disk is
  292. inserted.  Fortunately, there's a cure for this.  You can run DiskSalv,
  293. giving it the proper device input, without the floppy actually in the
  294. device.  Once DiskSalv starts up (at the "Should I Continue [Y]" prompt),
  295. it inhibits that drive.  The dangerous floppy can then be inserted
  296. without any problems.
  297.  
  298.  
  299. 3. LISCENCING AND DISTRIBUTION
  300.  
  301.     This program may be distributed free of charge, provided that no
  302. extra restrictions are placed on it.  Nominal charges for copying or
  303. on-line services are permitted provided that they are only for those
  304. services.  This program was written to help out the Amiga community, not 
  305. to make folks feel guilty.  Thus, no payment is required for its use.  
  306.  
  307.     I certainly don't mind donations, including donations of bug
  308. reports, comments, suggestions for future enhancements, macadamia nuts,
  309. or even software.  BUT PLEASE, DON'T SEND ME ANY PIRATED SOFTWARE.  YOU
  310. WILL REGRET IT.  I wouldn't have thought it necessary to mention this,
  311. given the quality of the people working with the Amiga (intelligent folks
  312. recognize superiority).  But I received several such disks from users of
  313. DiskSalv V1.0.  They all came from out of the country, and served me just
  314. fine as blank disks.  But it really annoys me to see this.  Anyway, I can
  315. be reached at:
  316.  
  317.                 Dave Haynie
  318.         645 Allen Avenue
  319.         Gibbstown, NJ 08027
  320.  
  321.         BIX:    hazy
  322.         PLINK:    D-DAVE H
  323.         USENET:    ...!cbmvax!daveh
  324.  
  325. If you really want to send money, consider sending a donation instead to:
  326.  
  327.         GreenPeace
  328.         1436 U Street NW
  329.         Washington, DC 20009
  330.  
  331. Tell me about it, and I'll include you in my registration files.  I know 
  332. you don't get rich from "ShareWare"; while I got some donations from
  333. DiskSalv V1.0 (which I'm certainly very grateful for), they certainly
  334. didn't pay for the writing of DiskSalv V1.2.  I wrote DiskSalv V1.2
  335. because it's needed, because I like to write programs in my spare time,
  336. and for my ego -- if I didn't write DiskSalv V1.2, someone else out
  337. there is going to write a better disk recovery program, and then mine
  338. won't be the best any more.  Don't know if DiskSalv V1.2 necessarily is
  339. the best these days, but I know it's better than DiskSalv V1.0.  Anyway,
  340. while DiskSalv's saving your disks, maybe the folks at GreenPeace will
  341. get a little extra money to save a few more important things, like clean
  342. air, clean water, and wildlife.  
  343.  
  344.  
  345.                 -Dave Haynie
  346.                  September 14, 1988
  347.